package com.yunxin.core.infra.persistence.mapper.merchant;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.yunxin.core.infra.persistence.entity.merchant.query.condition.MerchantPageCondition;
import com.yunxin.core.infra.persistence.entity.merchant.query.result.MerchantListResult;
import com.yunxin.core.infra.persistence.entity.merchant.query.result.MerchantPageResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * @author zero°
 * @since 2023-05-25
 */
@DS("core")
@Mapper
public interface MerchantInfoExtendMapper extends MerchantInfoMapper {

    /**
     * 获取商户下拉列表
     * @param merchantType merchantType
     * @return List<MerchantListResult>
     */
    List<MerchantListResult> listMerchant(@Param("merchantType") Integer merchantType);

    List<MerchantListResult> selectList(@Param("merchantName")String merchantName);

    /**
     * 根据ids获取商户列表
     * @param ids ids
     * @return  List<MerchantListResult>
     */
    List<MerchantListResult> listMerchantByIds(@Param("ids") Set<Long> ids);

    /**
     * 分页查询商户列表总条数
     * @param condition condition
     * @return int
     */
    long countMerchantPageQuery(MerchantPageCondition condition);

    /**
     * 分页查询商户列表
     * @param condition condition
     * @return List<MerchantPageResult>
     */
    List<MerchantPageResult> merchantPageQuery(MerchantPageCondition condition);

    String getAccountPhoneBySysUserId(@Param("sysUserId")Long sysUserId);
}
